﻿using Hangfire;
using Hangfire.SqlServer;
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace hangfireDemo
{
    partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configuration.UseSqlServerStorage("DataBase");

            app.UseHangfireDashboard();
            app.UseHangfireServer();
            RecurringJob.AddOrUpdate(() => Test(), Cron.Minutely );
        }

        //写入作业
        public void Test()
        {
            Console.WriteLine(DateTime.Now.ToString());
            RecurringJobManager manager = new RecurringJobManager();
            manager.RemoveIfExists(RecurringJob.)
        }
    }
}